treeviewcolumn: use g_clear_object when freeing cursor
authorChristian Hergert <chergert@redhat.com>
Tue, 27 Sep 2016 19:41:55 +0000 (12:41 -0700)
committerChristian Hergert <chergert@redhat.com>
Tue, 27 Sep 2016 19:41:55 +0000 (12:41 -0700)
There is the chance that the cursor returned NULL on systems
with missing cursors. This defensively handles that by checking
for a NULL cursor.

gtk/gtktreeviewcolumn.c

index 055d938469858b2f99ce82ece23327292faef38c..48b6fcd7c7904a84f6fa786852e766b02c57ecab 100644 (file)
@@ -1349,7 +1349,7 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
 
   gtk_tree_view_column_update_button (column);
 
-  g_object_unref (attr.cursor);
+  g_clear_object (&attr.cursor);
 }
 
 void